package ioc

import (
	"gitee.com/flycash/ai-gateway-demo/internal/grpc/interceptor/jwt"
	"github.com/gotomicro/ego/core/econf"
)

func InitJwtAuth() *jwt.JwtAuth {
	type jwtConfig struct {
		Key string `json:"key"`
	}
	var jwtConf jwtConfig
	err := econf.UnmarshalKey("jwt", &jwtConf)
	if err != nil {
		panic(err)
	}
	return jwt.NewJwtAuth(jwtConf.Key)
}
